package com.mysoft.gfyx.clue.controller;

import com.mysoft.framework.modeling.dataapi.DataApi;
import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.clue.controller.dto.GetQrCodeResponseDto;
import com.mysoft.gfyx.clue.remoteservice.RemoteWechatService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.LinkedHashMap;

@PubService(value = "/wechatDataApi", prefix = RequestPrefix.API)
@Tag(name = "微信控制器-API")
@Component("ClueWechatDataApiController")
public class WechatDataApiController extends Controller implements DataApi {
    @Resource
    private RemoteWechatService remoteWechatService;

    @PubAction(value = "/getOpenId", method = RequestMethod.POST)
    public String getOpenId() {
        return remoteWechatService.getOpenId();
    }

    @PubAction(value = "/getQrCode", method = RequestMethod.POST)
    public GetQrCodeResponseDto getQrCode() {
        return remoteWechatService.getQrCode();
    }
}
